package com.mrjy.maintain.controller;

import com.mrjy.common.entity.RecordIncomeInfo;
import com.mrjy.maintain.bo.IRecordIncomeInfoBo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@RequestMapping("/maintain/recordIncomeInfo")
@Controller
public class RecordIncomeInfoController {

    @Resource
    private IRecordIncomeInfoBo recordIncomeInfoBo;

    @RequestMapping("/insert")
    @ResponseBody
    public Object insert(RecordIncomeInfo info) {
        return recordIncomeInfoBo.txInsert(info);
    }


    @RequestMapping("/txDeleteByIds")
    @ResponseBody
    public Object txDeleteByIds(int[] ids) {
        return recordIncomeInfoBo.txDeleteByIds(ids);
    }


    @RequestMapping("/queryById")
    @ResponseBody
    public Object queryById(int id) {
        return recordIncomeInfoBo.queryById(id);
    }

    @RequestMapping("/txUpdateDisableFlag")
    @ResponseBody
    public Object txUpdateDisableFlag(RecordIncomeInfo info) {
        return recordIncomeInfoBo.txUpdateDisableFlag(info);
    }


    /**
     * 根据受益人id 查询这个人的收益总的明细
     *
     * @param info
     * @return
     */
    @RequestMapping("/queryDetailByBeneficiaryId")
    @ResponseBody
    public Object queryDetailByBeneficiaryId(RecordIncomeInfo info) {
        return recordIncomeInfoBo.queryDetailByBeneficiaryId(info);
    }

    /**
     * 根据受益人id 查询这个人的单项收益明细
     *
     * @param info
     * @return
     */
    @RequestMapping("/queryIncomePageByInfo")
    @ResponseBody
    public Object queryIncomePageByInfo(RecordIncomeInfo info) {
        return recordIncomeInfoBo.queryIncomePageByInfo(info);
    }


    /**
     * 根据受益人id 查询这个人的单项收益明细
     *
     * @param info
     * @return
     */
    @RequestMapping("/queryIncomeAll")
    @ResponseBody
    public Object queryIncomeAll() {
        return recordIncomeInfoBo.queryIncomeAll();
    }
}
